<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>饮水提醒 - 登录页面预览</title>
    <!-- 引入Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- 引入Font Awesome -->
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    
    <!-- 自定义Tailwind配置 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#00B42A',
                        secondary: '#0197F6',
                        accent: '#FF7D00',
                        bgLight: '#F6FFED',
                        bgGradient: '#E0F7FA'
                    },
                    fontFamily: {
                        sans: ['PingFang SC', 'Helvetica Neue', 'Arial', 'sans-serif']
                    }
                }
            }
        }
    </script>
    
    <!-- 自定义工具类 -->
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .glass-effect {
                backdrop-filter: blur(10px);
                background-color: rgba(255, 255, 255, 0.8);
            }
            .water-drop {
                animation: float 6s ease-in-out infinite;
            }
            .water-drop:nth-child(2) {
                animation-delay: 2s;
            }
            .water-drop:nth-child(3) {
                animation-delay: 4s;
            }
            @keyframes float {
                0% { transform: translateY(0px) scale(1); }
                50% { transform: translateY(-20px) scale(1.05); }
                100% { transform: translateY(0px) scale(1); }
            }
            .fade-in {
                animation: fadeIn 0.8s ease-in-out;
            }
            @keyframes fadeIn {
                from { opacity: 0; transform: translateY(20px); }
                to { opacity: 1; transform: translateY(0); }
            }
        }
    </style>
</head>
<body class="bg-gradient-to-b from-bgLight to-bgGradient min-h-screen flex items-center justify-center p-4">
    <!-- 背景装饰水滴 -->
    <div class="fixed inset-0 overflow-hidden pointer-events-none">
        <div class="water-drop absolute w-32 h-32 rounded-full bg-secondary/10 -top-10 -left-10"></div>
        <div class="water-drop absolute w-40 h-40 rounded-full bg-primary/5 right-10 top-1/4"></div>
        <div class="water-drop absolute w-28 h-28 rounded-full bg-accent/5 left-1/3 bottom-20"></div>
    </div>
    
    <!-- 主内容容器 -->
    <div class="max-w-md w-full relative z-10 fade-in">
        <!-- 品牌标识 -->
        <div class="flex flex-col items-center mb-10">
            <div class="w-20 h-20 rounded-full bg-primary/10 flex items-center justify-center mb-4">
                <i class="fa fa-tint text-4xl text-primary"></i>
            </div>
            <h1 class="text-3xl font-bold text-gray-800">饮水提醒</h1>
            <p class="text-gray-500 mt-1">登录您的账户，开始健康饮水之旅</p>
        </div>
        
        <!-- 登录卡片 -->
        <div class="bg-white rounded-2xl shadow-lg p-6 glass-effect">
            <!-- 用户名输入 -->
            <div class="mb-5">
                <label for="username" class="block text-gray-700 font-medium mb-2">用户名/邮箱</label>
                <div class="relative">
                    <span class="absolute inset-y-0 left-0 flex items-center pl-4 text-gray-400">
                        <i class="fa fa-user"></i>
                    </span>
                    <input type="text" id="username" 
                           class="w-full pl-12 pr-4 py-3 rounded-lg border border-gray-200 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all"
                           placeholder="请输入用户名或邮箱">
                </div>
            </div>
            
            <!-- 密码输入 -->
            <div class="mb-5">
                <div class="flex justify-between items-center mb-2">
                    <label for="password" class="block text-gray-700 font-medium">密码</label>
                    <a href="#" class="text-primary text-sm hover:underline">忘记密码？</a>
                </div>
                <div class="relative">
                    <span class="absolute inset-y-0 left-0 flex items-center pl-4 text-gray-400">
                        <i class="fa fa-lock"></i>
                    </span>
                    <input type="password" id="password" 
                           class="w-full pl-12 pr-12 py-3 rounded-lg border border-gray-200 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-all"
                           placeholder="请输入密码">
                    <span class="absolute inset-y-0 right-0 flex items-center pr-4 text-gray-400 cursor-pointer" id="togglePassword">
                        <i class="fa fa-eye-slash" id="passwordIcon"></i>
                    </span>
                </div>
            </div>
            
            <!-- 记住我 -->
            <div class="flex items-center mb-6">
                <input type="checkbox" id="rememberMe" class="w-4 h-4 text-primary border-gray-300 rounded focus:ring-primary/30">
                <label for="rememberMe" class="ml-2 text-gray-600 text-sm">记住我</label>
            </div>
            
            <!-- 登录按钮 -->
            <button id="loginBtn" class="w-full bg-primary hover:bg-primary/90 text-white font-medium py-3 px-4 rounded-lg transition-all flex items-center justify-center shadow-md hover:shadow-lg">
                <span>登录</span>
                <i class="fa fa-arrow-right ml-2"></i>
            </button>
            
            <!-- 分割线 -->
            <div class="flex items-center my-6">
                <div class="flex-grow border-t border-gray-200"></div>
                <span class="px-4 text-gray-500 text-sm">快速登录</span>
                <div class="flex-grow border-t border-gray-200"></div>
            </div>
            
            <!-- 第三方登录 -->
            <div class="flex justify-center space-x-8">
                <button class="w-14 h-14 bg-white rounded-lg shadow flex items-center justify-center hover:shadow-md transition-all" id="wechatLogin">
                    <i class="fa fa-weixin text-2xl text-[#09BB07]"></i>
                </button>
                <button class="w-14 h-14 bg-white rounded-lg shadow flex items-center justify-center hover:shadow-md transition-all" id="qqLogin">
                    <i class="fa fa-qq text-2xl text-[#12B7F5]"></i>
                </button>
                <button class="w-14 h-14 bg-white rounded-lg shadow flex items-center justify-center hover:shadow-md transition-all" id="githubLogin">
                    <i class="fa fa-github text-2xl text-gray-800"></i>
                </button>
            </div>
        </div>
        
        <!-- 注册提示 -->
        <div class="text-center mt-6">
            <span class="text-gray-600">还没有账户？</span>
            <a href="#" class="text-primary font-medium ml-1 hover:underline">立即注册</a>
        </div>
    </div>
    
    <!-- 登录成功弹窗 -->
    <div id="successModal" class="fixed inset-0 bg-black/30 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-xl p-6 w-80 text-center shadow-xl">
            <div class="w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-4">
                <i class="fa fa-check text-3xl text-primary"></i>
            </div>
            <h3 class="text-xl font-bold text-gray-800 mb-2">登录成功</h3>
            <p class="text-gray-600 mb-4">欢迎回来！即将进入应用...</p>
            <div class="w-3/4 mx-auto">
                <div class="w-full bg-gray-200 rounded-full h-2">
                    <div id="progressBar" class="bg-primary h-2 rounded-full" style="width: 0%"></div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- JavaScript交互逻辑 -->
    <script>
        // 密码显示切换
        const togglePassword = document.getElementById('togglePassword');
        const passwordInput = document.getElementById('password');
        const passwordIcon = document.getElementById('passwordIcon');
        
        togglePassword.addEventListener('click', () => {
            const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
            passwordInput.setAttribute('type', type);
            
            // 切换图标
            passwordIcon.classList.toggle('fa-eye-slash');
            passwordIcon.classList.toggle('fa-eye');
        });
        
        // 登录按钮点击事件
        const loginBtn = document.getElementById('loginBtn');
        const successModal = document.getElementById('successModal');
        const progressBar = document.getElementById('progressBar');
        
        loginBtn.addEventListener('click', () => {
            const username = document.getElementById('username').value;
            const password = document.getElementById('password').value;
            
            // 简单的表单验证
            if (!username || !password) {
                alert('请填写用户名和密码');
                return;
            }
            
            // 显示登录状态（禁用按钮并显示加载中）
            loginBtn.disabled = true;
            loginBtn.innerHTML = '<i class="fa fa-circle-o-notch fa-spin mr-2"></i>登录中...';
            
            // 模拟登录请求
            setTimeout(() => {
                // 恢复按钮状态
                loginBtn.disabled = false;
                loginBtn.innerHTML = '<span>登录</span><i class="fa fa-arrow-right ml-2"></i>';
                
                // 显示成功弹窗
                successModal.classList.remove('hidden');
                
                // 记住用户名（如果勾选）
                if (document.getElementById('rememberMe').checked) {
                    localStorage.setItem('waterReminderUser', username);
                } else {
                    localStorage.removeItem('waterReminderUser');
                }
                
                // 进度条动画
                let progress = 0;
                const interval = setInterval(() => {
                    progress += 2;
                    progressBar.style.width = `${progress}%`;
                    
                    if (progress >= 100) {
                        clearInterval(interval);
                        // 模拟跳转到主页面
                        alert('登录成功，即将跳转到主页面');
                        successModal.classList.add('hidden');
                    }
                }, 40);
            }, 2000);
        });
        
        // 第三方登录按钮
        document.getElementById('wechatLogin').addEventListener('click', () => {
            alert('微信登录功能暂未开放');
        });
        
        document.getElementById('qqLogin').addEventListener('click', () => {
            alert('QQ登录功能暂未开放');
        });
        
        document.getElementById('githubLogin').addEventListener('click', () => {
            alert('GitHub登录功能暂未开放');
        });
        
        // 页面加载时，自动填充记住的用户名
        window.addEventListener('DOMContentLoaded', () => {
            const savedUser = localStorage.getItem('waterReminderUser');
            if (savedUser) {
                document.getElementById('username').value = savedUser;
                document.getElementById('rememberMe').checked = true;
            }
        });
    </script>
</body>
</html>